package icooper.action;

import icooper.structs.SessionContent;

public abstract class SessionKey
{
	public final String encrypt(final String code) {
		StringBuilder buffer = new StringBuilder();

		for (char item : code.toCharArray()) {
			buffer.append(item+7<<2);
		}
		
		return buffer.toString();
	}

	public final String decrypt(final String code) {
		StringBuilder buffer = new StringBuilder();

		for (char item : code.toCharArray()) {
			buffer.append(item-7<<2);
		}
		
		return buffer.toString();
	}

	public abstract SessionContent saveSession();

	public abstract boolean recoverSession(SessionContent session);
}
